<?php
	//修改配置内容
	require '../biz/backend.php';

	class action extends backend
	{
		var $get_privilege_id = 86;
		var $post_privilege_id = 86;

		function do_get()
		{
			$url = isset( $this->input['reference'] ) ? $this->input['reference'] : config( 'server.HTTP_REFERER' );

			if( isset( $_GET['id'] ) && preg_match( '!^\d+$!', $_GET['id'] ) )
			{
				$cate = load( 'biz.cate' );
				$result = $cate->del( array( 'id'=>$_GET['id'] ) );

				if ( $result['success'] )
				{
					$this->prompt( '删除成功', array( array( 'url' => $url, 'name' => '返回列表' ) ) );
				}
				else
				{
					$this->prompt( '删除失败', $this->transform( $result['message'], config( 'server.HTTP_REFERER' ) ) );
				}

			}
		}
	}

	$action = new action();
	$action->run();
?>